// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Google Identity and Access Management (IAM) API Version v1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://cloud.google.com/iam/'>Google Identity and Access Management (IAM) API</a>
 *      <tr><th>API Version<td>v1
 *      <tr><th>API Rev<td>20170217 (778)
 *      <tr><th>API Docs
 *          <td><a href='https://cloud.google.com/iam/'>
 *              https://cloud.google.com/iam/</a>
 *      <tr><th>Discovery Name<td>iam
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Google Identity and Access Management (IAM) API can be found at
 * <a href='https://cloud.google.com/iam/'>https://cloud.google.com/iam/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Iam.v1
{
    /// <summary>The Iam Service.</summary>
    public class IamService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public IamService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public IamService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            projects = new ProjectsResource(this);
            roles = new RolesResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "iam"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://iam.googleapis.com/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return ""; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Google Identity and Access Management (IAM) API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

        }



        private readonly ProjectsResource projects;

        /// <summary>Gets the Projects resource.</summary>
        public virtual ProjectsResource Projects
        {
            get { return projects; }
        }

        private readonly RolesResource roles;

        /// <summary>Gets the Roles resource.</summary>
        public virtual RolesResource Roles
        {
            get { return roles; }
        }
    }

    ///<summary>A base abstract class for Iam requests.</summary>
    public abstract class IamBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new IamBaseServiceRequest instance.</summary>
        protected IamBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>V1 error format.</summary>
        [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<XgafvEnum> Xgafv { get; set; }

        /// <summary>V1 error format.</summary>
        public enum XgafvEnum
        {
            /// <summary>v1 error format</summary>
            [Google.Apis.Util.StringValueAttribute("1")]
            Value1,
            /// <summary>v2 error format</summary>
            [Google.Apis.Util.StringValueAttribute("2")]
            Value2,
        }

        /// <summary>OAuth access token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string AccessToken { get; set; }

        /// <summary>Data format for response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
            /// <summary>Media download with context-dependent Content-Type</summary>
            [Google.Apis.Util.StringValueAttribute("media")]
            Media,
            /// <summary>Responses with Content-Type of application/x-protobuf</summary>
            [Google.Apis.Util.StringValueAttribute("proto")]
            Proto,
        }

        /// <summary>OAuth bearer token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("bearer_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string BearerToken { get; set; }

        /// <summary>JSONP</summary>
        [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Callback { get; set; }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Pretty-print response.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("pp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> Pp { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadType { get; set; }

        /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadProtocol { get; set; }

        /// <summary>Initializes Iam parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "$.xgafv", new Google.Apis.Discovery.Parameter
                {
                    Name = "$.xgafv",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "access_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "access_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "bearer_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "bearer_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "callback", new Google.Apis.Discovery.Parameter
                {
                    Name = "callback",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "pp", new Google.Apis.Discovery.Parameter
                {
                    Name = "pp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "uploadType", new Google.Apis.Discovery.Parameter
                {
                    Name = "uploadType",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "upload_protocol", new Google.Apis.Discovery.Parameter
                {
                    Name = "upload_protocol",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "projects" collection of methods.</summary>
    public class ProjectsResource
    {
        private const string Resource = "projects";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ProjectsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            serviceAccounts = new ServiceAccountsResource(service);

        }

        private readonly ServiceAccountsResource serviceAccounts;

        /// <summary>Gets the ServiceAccounts resource.</summary>
        public virtual ServiceAccountsResource ServiceAccounts
        {
            get { return serviceAccounts; }
        }

        /// <summary>The "serviceAccounts" collection of methods.</summary>
        public class ServiceAccountsResource
        {
            private const string Resource = "serviceAccounts";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public ServiceAccountsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;
                keys = new KeysResource(service);

            }

            private readonly KeysResource keys;

            /// <summary>Gets the Keys resource.</summary>
            public virtual KeysResource Keys
            {
                get { return keys; }
            }

            /// <summary>The "keys" collection of methods.</summary>
            public class KeysResource
            {
                private const string Resource = "keys";

                /// <summary>The service which this resource belongs to.</summary>
                private readonly Google.Apis.Services.IClientService service;

                /// <summary>Constructs a new resource.</summary>
                public KeysResource(Google.Apis.Services.IClientService service)
                {
                    this.service = service;

                }


                /// <summary>Creates a ServiceAccountKey and returns it.</summary>
                /// <param name="body">The body of the request.</param>
                /// <param name="name">The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer
                /// the project from the account. The `account` value can be the `email` address or the `unique_id` of the service
                /// account.</param>
                public virtual CreateRequest Create(Google.Apis.Iam.v1.Data.CreateServiceAccountKeyRequest body, string name)
                {
                    return new CreateRequest(service, body, name);
                }

                /// <summary>Creates a ServiceAccountKey and returns it.</summary>
                public class CreateRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ServiceAccountKey>
                {
                    /// <summary>Constructs a new Create request.</summary>
                    public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.CreateServiceAccountKeyRequest body, string name)
                        : base(service)
                    {
                        Name = name;
                        Body = body;
                        InitParameters();
                    }


                    /// <summary>The resource name of the service account in the following format:
                    /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the
                    /// project will infer the project from the account. The `account` value can be the `email` address
                    /// or the `unique_id` of the service account.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string Name { get; private set; }


                    /// <summary>Gets or sets the body of this request.</summary>
                    Google.Apis.Iam.v1.Data.CreateServiceAccountKeyRequest Body { get; set; }

                    ///<summary>Returns the body of the request.</summary>
                    protected override object GetBody() { return Body; }

                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "create"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "POST"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "v1/{+name}/keys"; }
                    }

                    /// <summary>Initializes Create parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "name", new Google.Apis.Discovery.Parameter
                            {
                                Name = "name",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                            });
                    }

                }

                /// <summary>Deletes a ServiceAccountKey.</summary>
                /// <param name="name">The resource name of the service account key in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. Using `-` as a wildcard for the project
                /// will infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the
                /// service account.</param>
                public virtual DeleteRequest Delete(string name)
                {
                    return new DeleteRequest(service, name);
                }

                /// <summary>Deletes a ServiceAccountKey.</summary>
                public class DeleteRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.Empty>
                {
                    /// <summary>Constructs a new Delete request.</summary>
                    public DeleteRequest(Google.Apis.Services.IClientService service, string name)
                        : base(service)
                    {
                        Name = name;
                        InitParameters();
                    }


                    /// <summary>The resource name of the service account key in the following format:
                    /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. Using `-` as a
                    /// wildcard for the project will infer the project from the account. The `account` value can be the
                    /// `email` address or the `unique_id` of the service account.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string Name { get; private set; }


                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "delete"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "DELETE"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "v1/{+name}"; }
                    }

                    /// <summary>Initializes Delete parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "name", new Google.Apis.Discovery.Parameter
                            {
                                Name = "name",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$",
                            });
                    }

                }

                /// <summary>Gets the ServiceAccountKey by key id.</summary>
                /// <param name="name">The resource name of the service account key in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.
                ///
                /// Using `-` as a wildcard for the project will infer the project from the account. The `account` value can be the
                /// `email` address or the `unique_id` of the service account.</param>
                public virtual GetRequest Get(string name)
                {
                    return new GetRequest(service, name);
                }

                /// <summary>Gets the ServiceAccountKey by key id.</summary>
                public class GetRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ServiceAccountKey>
                {
                    /// <summary>Constructs a new Get request.</summary>
                    public GetRequest(Google.Apis.Services.IClientService service, string name)
                        : base(service)
                    {
                        Name = name;
                        InitParameters();
                    }


                    /// <summary>The resource name of the service account key in the following format:
                    /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.
                    ///
                    /// Using `-` as a wildcard for the project will infer the project from the account. The `account`
                    /// value can be the `email` address or the `unique_id` of the service account.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string Name { get; private set; }

                    /// <summary>The output format of the public key requested. X509_PEM is the default output
                    /// format.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("publicKeyType", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<PublicKeyTypeEnum> PublicKeyType { get; set; }

                    /// <summary>The output format of the public key requested. X509_PEM is the default output
                    /// format.</summary>
                    public enum PublicKeyTypeEnum
                    {
                        [Google.Apis.Util.StringValueAttribute("TYPE_NONE")]
                        TYPENONE,
                        [Google.Apis.Util.StringValueAttribute("TYPE_X509_PEM_FILE")]
                        TYPEX509PEMFILE,
                        [Google.Apis.Util.StringValueAttribute("TYPE_RAW_PUBLIC_KEY")]
                        TYPERAWPUBLICKEY,
                    }


                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "get"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "GET"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "v1/{+name}"; }
                    }

                    /// <summary>Initializes Get parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "name", new Google.Apis.Discovery.Parameter
                            {
                                Name = "name",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+/keys/[^/]+$",
                            });
                        RequestParameters.Add(
                            "publicKeyType", new Google.Apis.Discovery.Parameter
                            {
                                Name = "publicKeyType",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                    }

                }

                /// <summary>Lists ServiceAccountKeys.</summary>
                /// <param name="name">The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.
                ///
                /// Using `-` as a wildcard for the project, will infer the project from the account. The `account` value can be the
                /// `email` address or the `unique_id` of the service account.</param>
                public virtual ListRequest List(string name)
                {
                    return new ListRequest(service, name);
                }

                /// <summary>Lists ServiceAccountKeys.</summary>
                public class ListRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ListServiceAccountKeysResponse>
                {
                    /// <summary>Constructs a new List request.</summary>
                    public ListRequest(Google.Apis.Services.IClientService service, string name)
                        : base(service)
                    {
                        Name = name;
                        InitParameters();
                    }


                    /// <summary>The resource name of the service account in the following format:
                    /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.
                    ///
                    /// Using `-` as a wildcard for the project, will infer the project from the account. The `account`
                    /// value can be the `email` address or the `unique_id` of the service account.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string Name { get; private set; }

                    /// <summary>Filters the types of keys the user wants to include in the list response. Duplicate key
                    /// types are not allowed. If no key type is provided, all keys are returned.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("keyTypes", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<KeyTypesEnum> KeyTypes { get; set; }

                    /// <summary>Filters the types of keys the user wants to include in the list response. Duplicate key
                    /// types are not allowed. If no key type is provided, all keys are returned.</summary>
                    public enum KeyTypesEnum
                    {
                        [Google.Apis.Util.StringValueAttribute("KEY_TYPE_UNSPECIFIED")]
                        KEYTYPEUNSPECIFIED,
                        [Google.Apis.Util.StringValueAttribute("USER_MANAGED")]
                        USERMANAGED,
                        [Google.Apis.Util.StringValueAttribute("SYSTEM_MANAGED")]
                        SYSTEMMANAGED,
                    }


                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "list"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "GET"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "v1/{+name}/keys"; }
                    }

                    /// <summary>Initializes List parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "name", new Google.Apis.Discovery.Parameter
                            {
                                Name = "name",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                            });
                        RequestParameters.Add(
                            "keyTypes", new Google.Apis.Discovery.Parameter
                            {
                                Name = "keyTypes",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                    }

                }
            }

            /// <summary>Creates a ServiceAccount and returns it.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="name">Required. The resource name of the project associated with the service accounts, such as
            /// `projects/my-project-123`.</param>
            public virtual CreateRequest Create(Google.Apis.Iam.v1.Data.CreateServiceAccountRequest body, string name)
            {
                return new CreateRequest(service, body, name);
            }

            /// <summary>Creates a ServiceAccount and returns it.</summary>
            public class CreateRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ServiceAccount>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.CreateServiceAccountRequest body, string name)
                    : base(service)
                {
                    Name = name;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the project associated with the service accounts, such as
                /// `projects/my-project-123`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Iam.v1.Data.CreateServiceAccountRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}/serviceAccounts"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                }

            }

            /// <summary>Deletes a ServiceAccount.</summary>
            /// <param name="name">The resource name of the service account in the following format:
            /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer
            /// the project from the account. The `account` value can be the `email` address or the `unique_id` of the service
            /// account.</param>
            public virtual DeleteRequest Delete(string name)
            {
                return new DeleteRequest(service, name);
            }

            /// <summary>Deletes a ServiceAccount.</summary>
            public class DeleteRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string name)
                    : base(service)
                {
                    Name = name;
                    InitParameters();
                }


                /// <summary>The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the
                /// project will infer the project from the account. The `account` value can be the `email` address or
                /// the `unique_id` of the service account.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Gets a ServiceAccount.</summary>
            /// <param name="name">The resource name of the service account in the following format:
            /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer
            /// the project from the account. The `account` value can be the `email` address or the `unique_id` of the service
            /// account.</param>
            public virtual GetRequest Get(string name)
            {
                return new GetRequest(service, name);
            }

            /// <summary>Gets a ServiceAccount.</summary>
            public class GetRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ServiceAccount>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string name)
                    : base(service)
                {
                    Name = name;
                    InitParameters();
                }


                /// <summary>The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the
                /// project will infer the project from the account. The `account` value can be the `email` address or
                /// the `unique_id` of the service account.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Returns the IAM access control policy for a ServiceAccount.</summary>
            /// <param name="resource">REQUIRED: The resource for which the policy is being requested. `resource` is usually
            /// specified as a path. For example, a Project resource is specified as `projects/{project}`.</param>
            public virtual GetIamPolicyRequest GetIamPolicy(string resource)
            {
                return new GetIamPolicyRequest(service, resource);
            }

            /// <summary>Returns the IAM access control policy for a ServiceAccount.</summary>
            public class GetIamPolicyRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.Policy>
            {
                /// <summary>Constructs a new GetIamPolicy request.</summary>
                public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource)
                    : base(service)
                {
                    Resource = resource;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being requested. `resource` is usually
                /// specified as a path. For example, a Project resource is specified as `projects/{project}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "getIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:getIamPolicy"; }
                }

                /// <summary>Initializes GetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Lists ServiceAccounts for a project.</summary>
            /// <param name="name">Required. The resource name of the project associated with the service accounts, such as
            /// `projects/my-project-123`.</param>
            public virtual ListRequest List(string name)
            {
                return new ListRequest(service, name);
            }

            /// <summary>Lists ServiceAccounts for a project.</summary>
            public class ListRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ListServiceAccountsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string name)
                    : base(service)
                {
                    Name = name;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the project associated with the service accounts, such as
                /// `projects/my-project-123`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }

                /// <summary>Optional pagination token returned in an earlier
                /// ListServiceAccountsResponse.next_page_token.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional limit on the number of service accounts to include in the response. Further
                /// accounts can subsequently be obtained by including the ListServiceAccountsResponse.next_page_token
                /// in a subsequent request.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}/serviceAccounts"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Sets the IAM access control policy for a ServiceAccount.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy is being specified. `resource` is usually
            /// specified as a path. For example, a Project resource is specified as `projects/{project}`.</param>
            public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.Iam.v1.Data.SetIamPolicyRequest body, string resource)
            {
                return new SetIamPolicyRequest(service, body, resource);
            }

            /// <summary>Sets the IAM access control policy for a ServiceAccount.</summary>
            public class SetIamPolicyRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.Policy>
            {
                /// <summary>Constructs a new SetIamPolicy request.</summary>
                public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.SetIamPolicyRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy is being specified. `resource` is usually
                /// specified as a path. For example, a Project resource is specified as `projects/{project}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Iam.v1.Data.SetIamPolicyRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "setIamPolicy"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:setIamPolicy"; }
                }

                /// <summary>Initializes SetIamPolicy parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Signs a blob using a service account's system-managed private key.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="name">The resource name of the service account in the following format:
            /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer
            /// the project from the account. The `account` value can be the `email` address or the `unique_id` of the service
            /// account.</param>
            public virtual SignBlobRequest SignBlob(Google.Apis.Iam.v1.Data.SignBlobRequest body, string name)
            {
                return new SignBlobRequest(service, body, name);
            }

            /// <summary>Signs a blob using a service account's system-managed private key.</summary>
            public class SignBlobRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.SignBlobResponse>
            {
                /// <summary>Constructs a new SignBlob request.</summary>
                public SignBlobRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.SignBlobRequest body, string name)
                    : base(service)
                {
                    Name = name;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the
                /// project will infer the project from the account. The `account` value can be the `email` address or
                /// the `unique_id` of the service account.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Iam.v1.Data.SignBlobRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "signBlob"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}:signBlob"; }
                }

                /// <summary>Initializes SignBlob parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Signs a JWT using a service account's system-managed private key.
            ///
            /// If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an an expiry time of one hour by
            /// default. If you request an expiry time of more than one hour, the request will fail.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="name">The resource name of the service account in the following format:
            /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will infer
            /// the project from the account. The `account` value can be the `email` address or the `unique_id` of the service
            /// account.</param>
            public virtual SignJwtRequest SignJwt(Google.Apis.Iam.v1.Data.SignJwtRequest body, string name)
            {
                return new SignJwtRequest(service, body, name);
            }

            /// <summary>Signs a JWT using a service account's system-managed private key.
            ///
            /// If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an an expiry time of one hour by
            /// default. If you request an expiry time of more than one hour, the request will fail.</summary>
            public class SignJwtRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.SignJwtResponse>
            {
                /// <summary>Constructs a new SignJwt request.</summary>
                public SignJwtRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.SignJwtRequest body, string name)
                    : base(service)
                {
                    Name = name;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the
                /// project will infer the project from the account. The `account` value can be the `email` address or
                /// the `unique_id` of the service account.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Iam.v1.Data.SignJwtRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "signJwt"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}:signJwt"; }
                }

                /// <summary>Initializes SignJwt parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Tests the specified permissions against the IAM access control policy for a
            /// ServiceAccount.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. `resource` is usually
            /// specified as a path. For example, a Project resource is specified as `projects/{project}`.</param>
            public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.Iam.v1.Data.TestIamPermissionsRequest body, string resource)
            {
                return new TestIamPermissionsRequest(service, body, resource);
            }

            /// <summary>Tests the specified permissions against the IAM access control policy for a
            /// ServiceAccount.</summary>
            public class TestIamPermissionsRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.TestIamPermissionsResponse>
            {
                /// <summary>Constructs a new TestIamPermissions request.</summary>
                public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.TestIamPermissionsRequest body, string resource)
                    : base(service)
                {
                    Resource = resource;
                    Body = body;
                    InitParameters();
                }


                /// <summary>REQUIRED: The resource for which the policy detail is being requested. `resource` is
                /// usually specified as a path. For example, a Project resource is specified as
                /// `projects/{project}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Resource { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Iam.v1.Data.TestIamPermissionsRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "testIamPermissions"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+resource}:testIamPermissions"; }
                }

                /// <summary>Initializes TestIamPermissions parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "resource", new Google.Apis.Discovery.Parameter
                        {
                            Name = "resource",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }

            /// <summary>Updates a ServiceAccount.
            ///
            /// Currently, only the following fields are updatable: `display_name` . The `etag` is mandatory.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="name">The resource name of the service account in the following format:
            /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.
            ///
            /// Requests using `-` as a wildcard for the project will infer the project from the `account` and the `account` value
            /// can be the `email` address or the `unique_id` of the service account.
            ///
            /// In responses the resource name will always be in the format
            /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.</param>
            public virtual UpdateRequest Update(Google.Apis.Iam.v1.Data.ServiceAccount body, string name)
            {
                return new UpdateRequest(service, body, name);
            }

            /// <summary>Updates a ServiceAccount.
            ///
            /// Currently, only the following fields are updatable: `display_name` . The `etag` is mandatory.</summary>
            public class UpdateRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.ServiceAccount>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.ServiceAccount body, string name)
                    : base(service)
                {
                    Name = name;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The resource name of the service account in the following format:
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.
                ///
                /// Requests using `-` as a wildcard for the project will infer the project from the `account` and the
                /// `account` value can be the `email` address or the `unique_id` of the service account.
                ///
                /// In responses the resource name will always be in the format
                /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Iam.v1.Data.ServiceAccount Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/serviceAccounts/[^/]+$",
                        });
                }

            }
        }
    }

    /// <summary>The "roles" collection of methods.</summary>
    public class RolesResource
    {
        private const string Resource = "roles";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public RolesResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Queries roles that can be granted on a particular resource. A role is grantable if it can be used
        /// as the role in a binding for a policy for that resource.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual QueryGrantableRolesRequest QueryGrantableRoles(Google.Apis.Iam.v1.Data.QueryGrantableRolesRequest body)
        {
            return new QueryGrantableRolesRequest(service, body);
        }

        /// <summary>Queries roles that can be granted on a particular resource. A role is grantable if it can be used
        /// as the role in a binding for a policy for that resource.</summary>
        public class QueryGrantableRolesRequest : IamBaseServiceRequest<Google.Apis.Iam.v1.Data.QueryGrantableRolesResponse>
        {
            /// <summary>Constructs a new QueryGrantableRoles request.</summary>
            public QueryGrantableRolesRequest(Google.Apis.Services.IClientService service, Google.Apis.Iam.v1.Data.QueryGrantableRolesRequest body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }



            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Iam.v1.Data.QueryGrantableRolesRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "queryGrantableRoles"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/roles:queryGrantableRoles"; }
            }

            /// <summary>Initializes QueryGrantableRoles parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

            }

        }
    }
}

namespace Google.Apis.Iam.v1.Data
{    

    /// <summary>Audit log information specific to Cloud IAM. This message is serialized as an `Any` type in the
    /// `ServiceData` message of an `AuditLog` message.</summary>
    public class AuditData : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Policy delta between the original policy and the newly set policy.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("policyDelta")]
        public virtual PolicyDelta PolicyDelta { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Associates `members` with a `role`.</summary>
    public class Binding : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Specifies the identities requesting access for a Cloud Platform resource. `members` can have the
        /// following values:
        ///
        /// * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google
        /// account.
        ///
        /// * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google
        /// account or a service account.
        ///
        /// * `user:{emailid}`: An email address that represents a specific Google account. For example,
        /// `alice@gmail.com` or `joe@example.com`.
        ///
        /// * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-
        /// app@appspot.gserviceaccount.com`.
        ///
        /// * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
        ///
        /// * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example,
        /// `google.com` or `example.com`.
        ///
        /// </summary>
        [Newtonsoft.Json.JsonPropertyAttribute("members")]
        public virtual System.Collections.Generic.IList<string> Members { get; set; } 

        /// <summary>Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
        /// Required</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("role")]
        public virtual string Role { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>One delta entry for Binding. Each individual change (only one member in each entry) to a binding will
    /// be a separate entry.</summary>
    public class BindingDelta : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The action that was performed on a Binding. Required</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("action")]
        public virtual string Action { get; set; } 

        /// <summary>A single identity requesting access for a Cloud Platform resource. Follows the same format of
        /// Binding.members. Required</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("member")]
        public virtual string Member { get; set; } 

        /// <summary>Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
        /// Required</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("role")]
        public virtual string Role { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account key create request.</summary>
    public class CreateServiceAccountKeyRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Which type of key and algorithm to use for the key. The default is currently a 2K RSA key.  However
        /// this may change in the future.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keyAlgorithm")]
        public virtual string KeyAlgorithm { get; set; } 

        /// <summary>The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the default output
        /// format.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("privateKeyType")]
        public virtual string PrivateKeyType { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account create request.</summary>
    public class CreateServiceAccountRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Required. The account id that is used to generate the service account email address and a stable
        /// unique id. It is unique within a project, must be 6-30 characters long, and match the regular expression
        /// `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("accountId")]
        public virtual string AccountId { get; set; } 

        /// <summary>The ServiceAccount resource to create. Currently, only the following values are user assignable:
        /// `display_name` .</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("serviceAccount")]
        public virtual ServiceAccount ServiceAccount { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A
    /// typical example is to use it as the request or the response type of an API method. For instance:
    ///
    /// service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    ///
    /// The JSON representation for `Empty` is empty JSON object `{}`.</summary>
    public class Empty : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account keys list response.</summary>
    public class ListServiceAccountKeysResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The public keys for the service account.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keys")]
        public virtual System.Collections.Generic.IList<ServiceAccountKey> Keys { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account list response.</summary>
    public class ListServiceAccountsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The list of matching service accounts.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("accounts")]
        public virtual System.Collections.Generic.IList<ServiceAccount> Accounts { get; set; } 

        /// <summary>To retrieve the next page of results, set ListServiceAccountsRequest.page_token to this
        /// value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies
    /// for Cloud Platform resources.
    ///
    /// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the
    /// members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of
    /// permissions defined by IAM.
    ///
    /// **Example**
    ///
    /// { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com",
    /// "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer",
    /// "members": ["user:sean@example.com"] } ] }
    ///
    /// For a description of IAM and its features, see the [IAM developer's
    /// guide](https://cloud.google.com/iam).</summary>
    public class Policy : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same
        /// `role`. `bindings` with no members will result in an error.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bindings")]
        public virtual System.Collections.Generic.IList<Binding> Bindings { get; set; } 

        /// <summary>`etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of
        /// a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the
        /// read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned
        /// in the response to `getIamPolicy`, and systems are expected to put that etag in the request to
        /// `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
        ///
        /// If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten
        /// blindly.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        /// <summary>Version of the `Policy`. The default version is 0.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("version")]
        public virtual System.Nullable<int> Version { get; set; } 

    }    

    /// <summary>The difference delta between two policies.</summary>
    public class PolicyDelta : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The delta for Bindings between two policies.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bindingDeltas")]
        public virtual System.Collections.Generic.IList<BindingDelta> BindingDeltas { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The grantable role query request.</summary>
    public class QueryGrantableRolesRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Required. The full resource name to query from the list of grantable roles.
        ///
        /// The name follows the Google Cloud Platform resource format. For example, a Cloud Platform project with id
        /// `my-project` will be named `//cloudresourcemanager.googleapis.com/projects/my-project`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("fullResourceName")]
        public virtual string FullResourceName { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The grantable role query response.</summary>
    public class QueryGrantableRolesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The list of matching roles.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("roles")]
        public virtual System.Collections.Generic.IList<Role> Roles { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A role in the Identity and Access Management API.</summary>
    public class Role : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional.  A human-readable description for the role.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>The name of the role.
        ///
        /// When Role is used in CreateRole, the role name must not be set.
        ///
        /// When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g.,
        /// roles/logging.viewer for curated roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom
        /// roles.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>Optional.  A human-readable title for the role.  Typically this is limited to 100 UTF-8
        /// bytes.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("title")]
        public virtual string Title { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A service account in the Identity and Access Management API.
    ///
    /// To create a service account, specify the `project_id` and the `account_id` for the account.  The `account_id` is
    /// unique within the project, and is used to generate the service account email address and a stable `unique_id`.
    ///
    /// If the account already exists, the account's resource name is returned in util::Status's
    /// ResourceInfo.resource_name in the format of projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}. The
    /// caller can use the name in other methods to access the account.
    ///
    /// All other methods can identify the service account using the format
    /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. Using `-` as a wildcard for the project will
    /// infer the project from the account. The `account` value can be the `email` address or the `unique_id` of the
    /// service account.</summary>
    public class ServiceAccount : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. A user-specified description of the service account.  Must be fewer than 100 UTF-8
        /// bytes.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("displayName")]
        public virtual string DisplayName { get; set; } 

        /// <summary>@OutputOnly The email address of the service account.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("email")]
        public virtual string Email { get; set; } 

        /// <summary>Used to perform a consistent read-modify-write.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("etag")]
        public virtual string ETag { get; set; } 

        /// <summary>The resource name of the service account in the following format:
        /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.
        ///
        /// Requests using `-` as a wildcard for the project will infer the project from the `account` and the `account`
        /// value can be the `email` address or the `unique_id` of the service account.
        ///
        /// In responses the resource name will always be in the format
        /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>@OutputOnly. The OAuth2 client id for the service account. This is used in conjunction with the
        /// OAuth2 clientconfig API to make three legged OAuth2 (3LO) flows to access the data of Google
        /// users.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("oauth2ClientId")]
        public virtual string Oauth2ClientId { get; set; } 

        /// <summary>@OutputOnly The id of the project that owns the service account.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("projectId")]
        public virtual string ProjectId { get; set; } 

        /// <summary>@OutputOnly The unique and stable id of the service account.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("uniqueId")]
        public virtual string UniqueId { get; set; } 

    }    

    /// <summary>Represents a service account key.
    ///
    /// A service account has two sets of key-pairs: user-managed, and system-managed.
    ///
    /// User-managed key-pairs can be created and deleted by users.  Users are responsible for rotating these keys
    /// periodically to ensure security of their service accounts.  Users retain the private key of these key-pairs, and
    /// Google retains ONLY the public key.
    ///
    /// System-managed key-pairs are managed automatically by Google, and rotated daily without user intervention.  The
    /// private key never leaves Google's servers to maximize security.
    ///
    /// Public keys for all service accounts are also published at the OAuth2 Service Account API.</summary>
    public class ServiceAccountKey : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Specifies the algorithm (and possibly key size) for the key.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keyAlgorithm")]
        public virtual string KeyAlgorithm { get; set; } 

        /// <summary>The resource name of the service account key in the following format
        /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The private key data. Only provided in `CreateServiceAccountKey` responses.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("privateKeyData")]
        public virtual string PrivateKeyData { get; set; } 

        /// <summary>The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in
        /// `GetServiceAccountKey` or `ListServiceAccountKey` responses.
        ///
        /// Google never exposes system-managed private keys, and never retains user-managed private keys.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("privateKeyType")]
        public virtual string PrivateKeyType { get; set; } 

        /// <summary>The public key data. Only provided in `GetServiceAccountKey` responses.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("publicKeyData")]
        public virtual string PublicKeyData { get; set; } 

        /// <summary>The key can be used after this timestamp.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("validAfterTime")]
        public virtual object ValidAfterTime { get; set; } 

        /// <summary>The key can be used before this timestamp.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("validBeforeTime")]
        public virtual object ValidBeforeTime { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request message for `SetIamPolicy` method.</summary>
    public class SetIamPolicyRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to
        /// a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects)
        /// might reject them.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("policy")]
        public virtual Policy Policy { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account sign blob request.</summary>
    public class SignBlobRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The bytes to sign.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bytesToSign")]
        public virtual string BytesToSign { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account sign blob response.</summary>
    public class SignBlobResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The id of the key used to sign the blob.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keyId")]
        public virtual string KeyId { get; set; } 

        /// <summary>The signed blob.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("signature")]
        public virtual string Signature { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account sign JWT request.</summary>
    public class SignJwtRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The JWT payload to sign, a JSON JWT Claim set.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("payload")]
        public virtual string Payload { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The service account sign JWT response.</summary>
    public class SignJwtResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The id of the key used to sign the JWT.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keyId")]
        public virtual string KeyId { get; set; } 

        /// <summary>The signed JWT.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("signedJwt")]
        public virtual string SignedJwt { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Request message for `TestIamPermissions` method.</summary>
    public class TestIamPermissionsRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or
        /// 'storage.*') are not allowed. For more information see [IAM
        /// Overview](https://cloud.google.com/iam/docs/overview#permissions).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("permissions")]
        public virtual System.Collections.Generic.IList<string> Permissions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response message for `TestIamPermissions` method.</summary>
    public class TestIamPermissionsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A subset of `TestPermissionsRequest.permissions` that the caller is allowed.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("permissions")]
        public virtual System.Collections.Generic.IList<string> Permissions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
